package com.hllxd.hism.star.basic.service.service;

import com.hllxd.hism.star.basic.service.dao.mapper.mis.DataBaseServiceMapper;
import com.hllxd.hism.star.basic.service.model.metric.MetricServiceEntity;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 基础服务serviceiml
 */
@Slf4j
@Service("dataBaseService")
public class DataBaseServiceImpl implements DataBaseService {

    @Autowired
    private DataBaseServiceMapper dataBaseServiceMapper;



    /**
     * 服务列表
     * @return
     */
    @Override
    public List<MetricServiceEntity> listMetricServiceEntity() {
        return dataBaseServiceMapper.listMetricServiceEntity();
    }

  /*  @Override
    public List<String> queryDataList(String demandSide, String responsiblePerson) {
        return null;
    }*/

    @Override
    public List<MetricServiceEntity> listMetricServiceDetail(long id) {
        System.out.println("detail.............");
        return dataBaseServiceMapper.listMetricServiceDetail(id);
    }

    @Override
    public Long modifyServiceEntity(MetricServiceEntity aa) {
        return dataBaseServiceMapper.modifyServiceEntity(aa);
    }



    @Override
    public Long addServiceEntity(MetricServiceEntity aa) {
        System.out.println("aa is : "+new Gson().toJson(aa));
        return dataBaseServiceMapper.insertServiceEntity(aa);
    }

    @Override
    public Long deleteService(long id) {
        return dataBaseServiceMapper.deleteService(id);
    }


    //todo....


}
